<!--
 * @Author: your name
 * @Date: 2020-12-30 16:37:25
 * @LastEditTime: 2020-12-30 17:05:27
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \basiccss\data\zhuijia\zidingyiform.html
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>自定义表单</title>
    <style>
        body{
            padding: 50px;
        }
        .field{
            position: relative;
            width: 300px;
        }
        input{
            border: none; 
            outline: none;
            width: 100%;
        }
        .field::after{
            content: '';
            background: linear-gradient(to right,white,red,green,blue,white);
            height: 1px;
            width: 100%;
            display: block;
            position: relative;
            left: 0px;
            right: 0px;
        }
        .field:hover::before{
            content: attr(data-placeholder);
            position: absolute;
            top: -20px;
            left: 0px;
            color: #555555;
            font-size: 12px;
        }

    </style>
</head>
<body>
    <div class="field" data-placeholder="请输入少于100字的标题">
        <input type="text" id="name">
    </div>
    <div class="field" data-placeholder="请输入少于100字的标题">
        <input type="text" id="name">
    </div>

    <div class="field" data-placeholder="请输入少于100字的标题">
        <input type="text" id="name">
    </div>
</body>
</html>